﻿package com.tudou.home.controller
{
    import com.tudou.home.commands.*;
    import com.tudou.home.consts.*;
    import com.tudou.home.view.*;
    import flash.geom.*;
    import org.puremvc.as3.interfaces.*;
    import org.puremvc.as3.patterns.command.*;

    public class PrivacyCommand extends SimpleCommand
    {

        public function PrivacyCommand()
        {
            return;
        }// end function

        override public function execute(param1:INotification) : void
        {
            var _loc_4:Rectangle = null;
            var _loc_2:* = facade.retrieveMediator(PrivacyMediator.NAME) as PrivacyMediator;
            var _loc_3:* = facade.retrieveMediator(SkinMediator.NAME) as SkinMediator;
            switch(param1.getName())
            {
                case PrivacyCommandSet.SHOW_PRIVACY_PANEL:
                {
                    _loc_4 = _loc_3.isFullScreen ? (PlayerConsts.FULLSCREEN_RECT) : (PlayerConsts.NORMALSCREEN_RECT);
                    _loc_2.goTransform(_loc_4.width, _loc_4.height, _loc_3.isFullScreen);
                    _loc_2.show();
                    break;
                }
                case PrivacyCommandSet.HIDE_PRIVACY_PANEL:
                {
                    _loc_2.clear();
                    break;
                }
                case PrivacyCommandSet.RIGHT_PASSWORD:
                {
                    _loc_2.succeed();
                    break;
                }
                case PrivacyCommandSet.WRONG_PASSWORD:
                {
                    _loc_4 = _loc_3.isFullScreen ? (PlayerConsts.FULLSCREEN_RECT) : (PlayerConsts.NORMALSCREEN_RECT);
                    _loc_2.goTransform(_loc_4.width, _loc_4.height, _loc_3.isFullScreen);
                    _loc_2.showWrong();
                    break;
                }
                case ViewCommandSet.ENTER_FULLSCREEN_AND_RESIZE:
                {
                    _loc_4 = PlayerConsts.FULLSCREEN_RECT;
                    _loc_2.goTransform(_loc_4.width, _loc_4.height, true);
                    break;
                }
                case ViewCommandSet.NORMALSCREEN_RESIZE:
                {
                    _loc_4 = PlayerConsts.NORMALSCREEN_RECT;
                    _loc_2.goTransform(_loc_4.width, _loc_4.height, false);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

    }
}
